package com.itlong.cloud.resource;

import com.itlong.cloud.POJO.PO.DeviceEntranceInfoPO;
import com.itlong.cloud.commons.service.ICloudDeviceOnlineService;
import com.itlong.cloud.iot.service.server.HuawServerService;
import com.itlong.cloud.iottp.IIOTHwServiceClient;
import com.itlong.cloud.iottp.IIotDeviceOnlineServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <desc>
 *      访客人脸接口暴露。
 * <desc/>
 *
 * @createDate 2019/03/04.
 */
@RestController
public class IotHwServiceResource implements IIOTHwServiceClient {

    @Autowired
    HuawServerService huawServerService;

    /**
     * <desc>
     *      发布消息并拿到消息结果
     * </desc>
     *
     * @param commandName  命令名称
     * @param deviceId  华为云iot设备id
     * @param msg 消息内容
     * @author Jiaqi.X
     * @createDate 2018/04/11
     */
    @Override
    @RequestMapping(path = "/iot/huawei/pubDeviceMessageResponse",method = RequestMethod.POST)
    public String pubDeviceMessageResponse(@RequestParam("serviceId") String serviceId, @RequestParam("commandName") String commandName,
                                           @RequestParam("deviceId") String deviceId, @RequestParam("msg") String msg) {
        return huawServerService.pubDeviceMessageResponse(serviceId,commandName,deviceId,msg);
    }
}
